<template>
    <div class="gis-ifr">
        <div class="renyuan-title">
            <Logo1></Logo1>
            {{gistitle}}
            <router-link to="/gisplus" class="back-gisplus">
                <i class="iconfont icon-shouye2"></i>
                回到主页
            </router-link>
            <slot name="dropdownmenu"></slot>
        </div>
        <iframe :src="'http://baisha.checcbim.com/gis/?type='+type" frameborder="0" class="gis-ifr"
                id="gisiframe"></iframe>

        <!--<iframe :src="'http://localhost/trunk/baisha/?type='+type" frameborder="0" class="gis-ifr"-->
                <!--id="gisiframe"></iframe>-->
        <!--<GisSearch></GisSearch>-->
        <div class="img-box" style="left: 0.5rem;">
            <div class="img-box-title">
                <div class="img-box-title-left"></div>
                <p>项目概况</p>
                <router-link to="/gisview1" class="img-box-title-jump">查看详情</router-link>
            </div>
        </div>
    </div>
</template>

<script>
  import { Format } from '@/filters'
  import Logo1 from '@/components/Logo1.vue'

  export default {
    name: 'GisConfig',
    data () {
      return {
        durationTime: '',
        nowtime: '',
        type: this.$route.query.type || 1,
      }
    },
    methods: {},
    computed: {
      gistitle () {
        if (this.$route.query.type == 1) {
          return '风险及应急物资分布'
        } else if (this.$route.query.type == 2) {
          return '隐患分布'
        } else if (this.$route.query.type == 3) {
          return '视频分布'
        }
      }
    },
    mounted () {
      let that = this
      setInterval(function () {
        let oldTime = new Date('2018-03-12 00:00:00')
        let nowTime = new Date()
        console.log(nowTime)
        let durationTime = nowTime.getTime() - oldTime.getTime()
        let d = Math.floor(durationTime / 1000 / 60 / 60 / 24)
        let h = Math.floor(durationTime / 1000 / 60 / 60) % 24
        let m = Math.floor(durationTime / 1000 / 60) % 60
        let s = Math.floor(durationTime / 1000) % 60
        that.durationTime = d + '天' + h + '时' + m + '分' + s + '秒'
        // that.nowtime = nowTime.Format('yyyy-MM-dd hh:mm:ss')
      }, 1000)
    },
    components: {
      Logo1
    },
  }
</script>

<style scoped lang="scss">
    .gis-ifr {
        width: 100%;
        height: 100vh;
        overflow: hidden;
        z-index: 0;
        position: relative;
    }

    .gis-title {
        width: 100%;
        min-height: 85px;
        display: flex;
        align-items: center;
        justify-content: space-between;
        position: fixed;
        left: 0;
        top: 0;
        z-index: 10000;
        color: #fff;
        text-align: center;
        z-index: 1;

        span {
            position: absolute;
            top: 0.5rem;
            padding: 0.1rem;
            border-radius: 0.04rem;
            background: rgba(0, 0, 0, 0.5);
            box-shadow: 0 0 15px 0 rgba(255, 255, 255, 0.3);
        }

        .anquanshigong {
            left: 15%;
            color: #67C23A;
        }

        .weather {
            right: 15%;
        }

        .gis-titles {
            position: absolute;
            top: 0;
            width: 100%;
            height: 70px;
            line-height: 70px;
            font-size: 22px;
        }

        .gis-titles-min {
            position: absolute;
            top: 55px;
            width: 100%;
            font-size: 12px;
        }

        .gis-title-img {
            width: 100%;
            height: 100px;
        }

    }

    .gis-title-left {
        display: flex;
        align-items: center;
    }

    .renyuan-title {
        position: absolute;
        top: 0;
        left: 0;
        width: 100%;
        height: 1.2rem;
        background-image: url('../../assets/img/renyuan-title.png');
        background-size: 100% 100%;
        background-repeat: no-repeat;
        background-position: center;
        font-size: 0.28rem;
        color: #fff;
        text-align: center;
        line-height: 1rem;
        z-index: 1;
    }

    .renyuan-title > .back-gisplus {
        position: absolute;
        right: .5rem;
        top: .1rem;
        width: 1rem;
        height: .4rem;
        font-size: .14rem;
        line-height: .4rem;
        color: #F8BC38;
    }
</style>